package collectionandmap;

public class KeyBean {
	
	public KeyBean() {
	}
	public KeyBean(Integer key, String name){
		this.key = key;
		this.name = name;
	}
	private Integer key;
	private String name;
	
	public Integer getKey() {
		return key;
	}
	public void setKey(Integer key) {
		this.key = key;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Override
	public int hashCode() {
		return this.key.hashCode();
	}
	@Override
	public boolean equals(Object obj) {
		if(!(obj instanceof KeyBean)){
			return false;
		}
		return ((KeyBean)obj).getKey().equals(this.key);
	}
	
}
